import http from "@/utils/https";

/**
 * 获取预付订单列表
 */
export const getMembeOrderPre = () => {
  return http({ url: "/member/order/pre" });
};

// 提交订单 /member/order
export const postMemberOrder = (data) => {
  return http({
    url: '/member/order',
    method: 'post',
    data
  })
}
/**
 * 根据订单id来查阅订单详情
 * @param {String} id 订单id
 */
export const getMembeOrderById = (id) => {
  return http({ url: `/member/order/${id}` });
};

// 支付-微信-小程序
export const getPayWxpayMinipay = (orderId, appid = 'wx26729f20b9efae3a') => {
  return http({
    url: '/pay/wxPay/miniPay',
    data: { orderId, appid }
  })
}
// 模拟支付-更新订单支付状态 /pay/mock
export const getPayMock = (orderId) => {
  return http({
    url: '/pay/mock',
    data: { orderId }
  })
}

// 获取订单列表 /member/order
export const getMemberOrder = (data) => {
  return http({
    url: '/member/order',
    data
  })
}
// 立即购买 /member/order/pre/now
export const getMemberOrderPreNow = (data) => {
  return http({
    url: '/member/order/pre/now',
    data
  })
}